package com.core.service.Impl;

import com.core.dao.DjsDao;
import com.core.dao.LygDao;
import com.core.domain.DTO.LygStadiumDTO;
import com.core.domain.Stadium;
import com.core.domain.User;
import com.core.service.LygService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

/**
 * @author 刘玉贵
 * @version 666
 */

@Service
public class LygServiceImpl implements LygService {
    @Autowired
    private LygDao lygDao;

    @Override
    public List<LygStadiumDTO> selectAllStadium() {
        return lygDao.selectAllStadium();
    }

    @Override
    public int countById(int id) {
        return lygDao.countById(id);
    }

    @Override
    public void insertResInf(Timestamp start, Timestamp end, int teamId, int userId,int reservedNumber) {
        lygDao.insertResInf(start,end,teamId,userId,reservedNumber);
    }

    @Override
    public Integer isBooked(Integer userId, Integer teamId) {
        return lygDao.isBooked(userId,teamId);
    }

    @Override
    public void delete(Integer userId, Integer teamId) {
        lygDao.delete(userId,teamId);
    }

    @Override
    public User getInf(Integer userId) {
        return lygDao.getInf(userId);
    }

    @Override
    public void update(User user) {
        System.out.println("执行了serviceupdate");
        lygDao.update(user);
    }
}
